package com.mofeng.myshop.service.impl;

import com.mofeng.myshop.domain.po.UserPower;
import com.mofeng.myshop.domain.vo.user.UserPowerVo;
import com.mofeng.myshop.mapper.UserPowerMapper;
import com.mofeng.myshop.service.IUserPowerService;
import com.mofeng.myshop.until.R;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 用户权限 服务实现类
 * </p>
 *
 * @author MoFeng
 * @since 2024-04-21
 */
@Service
@RequiredArgsConstructor
public class UserPowerServiceImpl implements IUserPowerService {

    private final UserPowerMapper userPowerMapper;

    /**
     * 获取权限列表
     */
    @Override
    public R getPowerList() {
        List<UserPower> userPowers = userPowerMapper.finAll();
        return R.SUCCESS().setData(UserPowerVo.change(userPowers));
    }
}
